using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Cliente.Objetos;

namespace Cliente.Forms
{
    public partial class FormGrid : Form
    {
        public FormGrid()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //bgPesq.RunWorkerAsync();
            Controller.Pessoa.PopularGrid(this.dg,tbxNome.Text);                
        }

        private void bgPesq_DoWork(object sender, DoWorkEventArgs e)
        {

        }

        private void dg_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                App.oMainForm.PopulateForms(this.dg.Rows[e.RowIndex]);
                this.Close();
            }
        }


        private void dg_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                App.oMainForm.PopulateForms(this.dg.Rows[e.RowIndex]);
                this.Close();
            }
        }
    }
}